#include <stdio.h>
#include <pthread.h>
#include <unistd.h>

//线程1
void pthread_1(void* arg)
{
    while(1)
    {
        printf("pthread2: ");
        printf("%s\n", (char*)arg);
        sleep(1);
    }

}

//线程2
void pthread_2(void* arg)
{
    while(1)
    {
        printf("pthread1: ");
        printf("%s\n", (char*)arg);
        sleep(1);
    }
   
}

//主进程
int main()
{
    pthread_t pthread;
    int ret  = -1;

    //创建进程1
    ret = pthread_create(&pthread, NULL, (void*)pthread_1, "aaaa");
     //创建进程2
    ret = pthread_create(&pthread, NULL, (void*)pthread_2, "bbbb");

    sleep(10);
    return 0;
}